#ifndef LOGGER_H
#define LOGGER_H

#include <QString>

#include "Lockable.h"

//class QString;

#define LOGGER_INDENT_SPACE	"    "

class Logger {
public:
	enum Level {
		Debug,
		Info,
		Warning,
		Error,
		Fatal};

private:
	static bool color;
	static Level level;
	static Lockable lock;
	static int levelToInt(Level l);
	static bool checkLevel(Level l);
	static void doDebug(const char* message, int indent);
	static void doInfo(const char* message, int indent);
	static void doWarning(const char* message, int indent);
	static void doError(const char* message, int indent);
	static void doFatal(const char* message, int indent);

public:
	static void setColor(bool color);
	static void setLevel(Level level); 
	static void debug(const QString& message, int indent = 0);
	static void debug(const char* message, int indent = 0);
	static void info(const QString& message, int indent = 0);
	static void info(const char* message, int indent = 0);
	static void warning(const QString& message, int indent = 0);
	static void warning(const char* message, int indent = 0);
	static void error(const QString& message, int indent = 0);
	static void error(const char* message, int indent = 0);
	static void fatal(const QString& message, int indent = 0);
	static void fatal(const char* message, int indent = 0);
};


#endif	/* LOGGER_H */


